package com.csnf.feign;

import com.csnf.feign.fallback.WeatherFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

//http://aliv18.data.moji.com/whapi/json/alicityweather/condition
@FeignClient(value = "service-weather",url = "http://aliv18.data.moji.com",
        fallback = WeatherFeignFallback.class)
public interface WeatherFeignClient {

//    @PostMapping(value = "/whapi/json/alicityweather/condition")
//    String getWeather(@RequestHeader("Authorization") String auth,
//                      @RequestParam("token") String token,
//                      @RequestParam("cityId") String cityId);


//兜底服务
    @PostMapping(value = "/whapi/json/alicityweather/condition")
    String getWeather(@RequestHeader("Authorization") String auth,
                      @RequestParam("token") String token,
                      @RequestParam("cityId") String cityId);
}
